package com.lzs.baseruku.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzs.baseruku.mapper.OtherinMapper;
import com.lzs.baseruku.service.OtherinService;
import com.lzs.entity.Otherin;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ymx
 * @since 2020-11-25
 */
@Service
public class OtherinServiceImpl extends ServiceImpl<OtherinMapper, Otherin> implements OtherinService {

    @Override
    public Page<Otherin> selectreceive(Integer page, Integer limit, Otherin otherin) {
        Page<Otherin> pageInfo=new Page<>(page,limit);
        String otherinno=otherin.getOtherinno();
        String state=otherin.getState();
        QueryWrapper queryWrapper=new QueryWrapper();

        if (StringUtils.isNotEmpty(otherinno)){
            queryWrapper.like("otherinno",otherinno);
        }
        if (StringUtils.isNotEmpty(state)){
            queryWrapper.like("state",state);
        }
        this.baseMapper.selectPage(pageInfo,queryWrapper);
        return pageInfo;
    }
}
